<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>退货管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="icon" href="favicon.ico">
    <link rel="stylesheet" href="/layuicms/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/layuicms/css/public.css" media="all" />
</head>
<body class="childrenBody">
<!-- 查询条件开始 -->
<!--    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
        <legend>查询条件</legend>
    </fieldset>-->
<blockquote class="layui-elem-quote" style="height: 80px;">
    <form action="" method="post" id="searchFrm" lay-filter="searchFrm" class="layui-form">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">供应商</label>
                <div class="layui-input-inline">
                    <select name="providerid" id="search_provider">
                        <option value="0">请选择供应商</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">商品名称</label>
                <div class="layui-input-block">
                    <select name="goodsid" id="search_goodsid">
                        <option value="0">请选择商品</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">开始时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="startTime" readonly="readonly" id="startTime"  autocomplete="off"  class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">结束时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="endTime" id="endTime" readonly="readonly" autocomplete="off"  class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <div class="layui-input-block" style="text-align: center;">
                    <button type="button" class="layui-btn" lay-submit="" lay-filter="doSearch"> <span class="layui-icon layui-icon-search"></span> 查询</button>
                    <button type="reset" class="layui-btn layui-btn-warm"><span class="layui-icon layui-icon-refresh-1"></span> 重置</button>
                </div>
            </div>
        </div>
    </form>
</blockquote>
<!--查询条件结束-->
<!--数据表格开始-->
<div>
    <table class="layui-hide" id="outportTable" lay-filter="outportTable"></table>
</div>
</div>
<!--数据表格结束-->
</body>
<script type="text/javascript" src="/layuicms/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['jquery','form','table','layer','laydate'],function(){
        var $ = layui.jquery;
        var form=layui.form;
        var table = layui.table;
        var layer = layui.layer;
        var upload = layui.upload;
        var laydate = layui.laydate;
        //初始化日期
        laydate.render({
            elem:'#startTime',
            type:'datetime'
        });
        laydate.render({
            elem:'#endTime',
            type:'datetime'
        })
        //加载数据
        var tableIns = table.render({
            elem: '#outportTable'
            ,url:'/outport/loadAllOutport'
            ,toolbar: true //开启头部工具栏，并为其绑定左侧模板
            ,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                ,layEvent: 'LAYTABLE_TIPS'
                ,icon: 'layui-icon-tips'
            }]
            ,title: '用户登录退货数据表'
            ,height:'full-140'
            ,page: true
            ,cols: [ [
                {field:'id', title:'退货ID',align:'center' }
                ,{field:'providername', title:'供应商',align:'center'}
                ,{field:'goodsname', title:'商品名称',align:'center'}
                ,{field:'paytype', title:'支付方式',align:'center'}
                ,{field:'outputtime', title:'退货时间',align:'center' ,width:180}
                ,{field:'number', title:'退货数量',align:'center'}
                ,{field:'outportprice', title:'退货价格',align:'center'}
                ,{field:'remark', title:'备注',align:'center'}
                ,{field:'operateperson', title:'操作员',align:'center'}
            ] ]
        });
        //加载查询条件供应商的下拉列表
        $.get("/provider/loadAllProviderForSelect",function(res){
            var data=res.data;
            var dom=$("#search_provider");
            var html='<option value="0">请选择供应商</option>'
            $.each(data,function(index,item){
                html+='<option value="'+item.id+'">'+item.providername+'</option>'
            });
            dom.html(html);
            form.render("select");
        });
        //加载查询条件商品的下拉列表
        $.get("/goods/loadAllGoodsForSelect",function(res){
            var data=res.data;
            var dom=$("#search_goodsid");
            var html='<option value="0">请选择商品</option>'
            $.each(data,function(index,item){
                html+='<option value="'+item.id+'">'+item.goodsname+'-'+item.size+'['+item.providername+']</option>'
            });
            dom.html(html);
            form.render("select");
        });
        //加载查询条件供应商的下拉列表
       /* $.get("/provider/loadAllProviderForSelect",function (res) {
            alert(res.data());
            var  data = res.data;
            var dom= $('#serach_provider');
            var html = '<option value="0">请选择供应商</option>';
            $.each(data,function (index,items) {
                html+='<option value="'+items.id+'>'+items.providername+'</option>';
            })
            dom.html(html);
            form.render("select");
        });*/
        //模糊查询
        form.on("submit(doSearch)",function (data) {
            tableIns.reload({
                where:data.field,
                page:{
                    curr:1
                }
            });
            return false;
        });
    });
</script>
</html>